home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / zindent7.zip / ZINUTL.INC < prev    next >
Text File  |  1987-03-30  |  7KB  |  236 lines

  1.  
  2. (***********************************************************)
  3. (* Include File                                            *)
  4. (* System Utility,   v. 0600am, fri, 27.Mar.87, Glen Ellis *)
  5. (***********************************************************)
  6.  
  7.  
  8. (* procedure ****************************************************)
  9.  
  10. procedure pALARM;
  11.  
  12. var  x : integer;
  13. begin
  14.    for x := 1 to 3
  15.       do write(chr(7));
  16. end;
  17.  
  18.  
  19. (*==============================================================*)
  20. (* System Variable Handling Procedures *)
  21.  
  22. (* Procedure ******************************************************)
  23. (* System Var Initialize,   v. 0500am, sat, 06.Sep.86, Glen Ellis *)
  24.  
  25. procedure  pSysInitz;  (* uses globals *)
  26.  
  27. begin  (* proc *)
  28.    SysCmdLine := false;
  29.    SysCmdFile := false;
  30.    SysCmdUser := false;
  31.    SysInFilename  := ' ';
  32.    SysInSource[1] := ' ';
  33.    SysEnableBegin := false;
  34.    SysLineCnt     := false;
  35.    SysIndentNum   := 0;
  36.    SysIndentPos   := 0;
  37.    SysLenMax      := 0;
  38.    SysComment := true;
  39.    SysLineCnt := false;
  40.    SysVertiate := false;
  41.    SysInSourceCnt := 0;
  42.    SysInSourceMax := 0;
  43. end;  (* proc *)
  44.  
  45.  
  46. (* procedure ******************************************************)
  47. (* SysLvlInit,   v. 1244pm, sun, 31.Aug.86, Glen Ellis            *)
  48.  
  49. procedure pSysLvlInit;
  50.  
  51. begin (* P *)
  52.    (* required for KEYWORD.INC *)
  53.    (* fresh for each file being parsed *)
  54.    (* not all used in any one application *)
  55.    (* rename these if need be, assign in SYSTEM.VAR *)
  56.    (* long memvar names used for programming readability  *)
  57.    (* short memvar names used for passing parms to procedures *)
  58.    SysEnableBegin := false; (* flag for first 'begin' *)
  59.    SEB            := false;
  60.    SysLevelIf     := 0;
  61.    SLI       := 0;
  62.    SysLevelCase   := 0;
  63.    SLC       := 0;
  64.    SysLevelWhile  := 0;
  65.    SLW       := 0;
  66.    SysLevelBegin  := 0;
  67.    SLB       := 0;
  68.    SysLevelRepeat := 0;
  69.    SLR       := 0;
  70. end; (* P *)
  71.  
  72.  
  73.  
  74. (* procedure ******************************************************)
  75. (* Sys Var Short Update, v. 0600am, wed, 17.Sep.86, Glen Ellis  *)
  76.  
  77. procedure pSysVarShortUpdt;
  78.  
  79. begin (* P *)
  80.    (* update short named level from long named level vars *)
  81.    (* required for KEYWORD.INC *)
  82.    (* fresh for each file being parsed *)
  83.    (* not all used in any one application *)
  84.    (* rename these if need be, assign in SYSTEM.VAR *)
  85.    SOLL := SysOutLine;
  86.    SIP  := SysIndentPos;
  87.    SIN  := SysIndentNum;
  88.    SLM  := SysLenMax;
  89.    SMW  := SysMarkWrite;
  90.    SEB  := SysEnableBegin;
  91.    SLI  := SysLevelIF;
  92.    SLC  := SysLevelCASE;
  93.    SLW  := SysLevelWHILE;
  94.    SLB  := SysLevelBEGIN;
  95.    SLR  := SysLevelREPEAT;
  96. end; (*proc*)
  97.  
  98.  
  99.  
  100. (* procedure ******************************************************)
  101. (* Sys Var Long UPDate,   v. 0600am, wed, 17.Sep.86, Glen Ellis *)
  102.  
  103. procedure pSysVarLongUpdt;
  104.  
  105. begin (*proc*)
  106.    (* Downdate short named level into long named level vars *)
  107.    (* required for KEYWORD.INC *)
  108.    (* fresh for each file being parsed *)
  109.    (* not all used in any one application *)
  110.    (* rename these if need be, assign in SYSTEM.VAR *)
  111.    SysOutLine := SOLL;
  112.    SysIndentPos := SIP;
  113.    SysIndentNum := SIN;
  114.    SysLenMax := SLM;
  115.    SysMarkWrite := SMW;
  116.    SysEnableBegin := SEB;
  117.    SysLevelIF := SLI;
  118.    SysLevelCASE := SLC;
  119.    SysLevelWHILE := SLW;
  120.    SysLevelBEGIN := SLB;
  121.    SysLevelREPEAT := SLR;
  122. end; (*proc*)
  123.  
  124.  
  125.  
  126. (* procedure ****************************************************)
  127. (* Say System Variables, v. 0900am, sat, 20.Sep.86, Glen Ellis  *)
  128.  
  129. procedure pSaySysVar;
  130.  
  131. var
  132. line : Thestr;
  133. cmdline, cmdfile, cmduser : string7 ;
  134. comment, linecnt, vertiate : string7;
  135. indentnum, indentpos, lenmax, insourcecnt, insourcemax : string7;
  136.  
  137. begin (* P *)
  138.    (* BIG display prior to CORE *)
  139.    (* pause for preceding display of filename list *)
  140.    pDelay4;
  141.    (* operating parameters *)
  142.    FOR x := 1 to 23
  143.       do writeln; (* Apple/CPM clear screen *)
  144.    begin (* say sys var *)
  145.       line := 'A: SysUtl.inc, pSaySysVar : OPERATING variables';
  146.       pSayLnCJ(line,80);
  147.       line := 'Parameter Source Control variables';
  148.       pSayLnCJ(line,80);
  149.       IF SysCmdLine then cmdline:='true' else cmdline:= 'false';
  150.       IF SysCmdFile then cmdfile:='true' else cmdfile:= 'false';
  151.       IF SysCmdUser then cmduser:='true' else cmduser:= 'false';
  152.       line := 'L='+cmdline+' : F='+cmdfile+' : U='+cmduser ;
  153.       pSayLnCJ(line,80);
  154.       line := 'SysInFileName = ' + SysInFileName;
  155.       pSayLnCJ(line,80);
  156.       IF SysComment  then comment  :='true' else comment  := 'false';
  157.       IF SysLineCnt  then linecnt  :='true' else linecnt  := 'false';
  158.       IF SysVertiate then vertiate :='true' else vertiate := 'false';
  159.       writeln;
  160.       line := 'SysComment     = ' + comment;
  161.       pSayLnCJ(line,80);
  162.       line := 'SysLineCNT     = ' + linecnt;
  163.       pSayLnCJ(line,80);
  164.       line := 'SysVertiate    = ' + vertiate;
  165.       pSayLnCJ(line,80);
  166.       str(SysIndentNum,indentnum);
  167.       str(SysIndentPos,indentpos);
  168.       str(SysLenMax   ,lenmax   );
  169.       line :=
  170.       'SysIndentNUM = ' + indentnum +
  171.       ' : SysIndentPOS = ' + indentpos +
  172.       ' : SysLineMAX   = ' + lenmax;
  173.       pSayLnCJ(line,80);
  174.       str(SysInSourceCnt,insourcecnt);
  175.       str(SysInSourceMax,insourcemax);
  176.       line :=
  177.       'SysInSourceCNT = ' + insourcecnt +
  178.       ' : SysInsourceMAX = ' + insourcemax;
  179.       pSayLnCJ(line,80);
  180.       line := 'SysPgmMod      = ' + SysPgmMod;
  181.       pSayLnCJ(line,80);
  182.       line := '<CR> continue, <ESC> halt';
  183.       pSayLnCJ(line,80);
  184.       pReadCR;
  185.       (* wait for programmer; takes time to read this display *)
  186.    end; (* say sys var *)
  187.  
  188. end; (*proc*)
  189.  
  190.  
  191.  
  192. (* procedure ***********************************************)
  193. (* System Filenames, v. 0719am, sun, 31.Aug.86, Glen Ellis    *)
  194.  
  195. procedure pSaySysFiles;
  196.  
  197. begin(* P *)
  198.    writeln;
  199.    writeln('SysPgmMod = ',SysPgmMod);
  200.    writeln('     file.BAK  = ',SysFile0);
  201.    writeln('SysInFilename  = ',SysFile1);
  202.    writeln('     file.$$$  = ',SysFile2);
  203.    writeln;
  204. end; (* P *)
  205.  
  206.  
  207.  
  208. (* procedure ***************************************************)
  209. (* SYStem LeVeL Write , v. 0734am, sun, 31.Aug.86, Glen Ellis  *)
  210.  
  211. procedure pSysLvlWrite;
  212.  
  213. begin (* P *)
  214.    (* uses system vars *)
  215.    pSysVarShortUpdt;
  216.    IF SysComment then
  217.    begin
  218.       (**)
  219.       (* Displays Count of Keyword Actions : (shift right - shift left ) *)
  220.       (* very useful for debugging *)
  221.       (* has been usefully attached to end of output files. *)
  222.       (**)
  223.       (* dBASE has three distinct forms *)
  224.       IF SysPgmMod = 'DB' then
  225.       writeln(SysOutFile,SPMSL,':I:',SLI,'   :C:',SLC,'   :W:',SLW,SPMSR);
  226.       (**)
  227.       (* Pascal can be simplified to one form *)
  228.       IF SysPgmMod = 'TP' then
  229.       writeln(SysOutFile,SPMSL,':B:',SLB,SPMSR);
  230.       (**)
  231.    end;
  232. end; (*proc*)
  233.  
  234.  
  235. (***********************************************************************)
  236. (*<<<>>>*)